Skip to content

fix(schematic): honor ignored power pins - #280

Closed
nordic-style wants to merge 2 commits into
mixelpixx:mainfrom
nordic-style:codex/fix/honor-ignored-power-pins
Closed

fix(schematic): honor ignored power pins#280
nordic-style wants to merge 2 commits into
mixelpixx:mainfrom
nordic-style:codex/fix/honor-ignored-power-pins

Conversation

@nordic-style

Copy link
Copy Markdown
Contributor

User-visible problem and scope

validate_component_connections(ignore_power_pins: true) advertised that power pins would be ignored, but the handler never read the flag. Designs could therefore report unwanted unconnected-power findings even when the caller explicitly excluded them.

This PR parses KiCad library pin electrical types and omits only power_in and power_out pins when requested.

Refs #251

Depends on #272, which makes placed-unit pin resolution correct for multi-unit symbols. Once #272 merges, this PR reduces to one focused follow-up commit.

Root cause and design

The validator had pin coordinates and numbers but not the library electrical type, so the schema value was inert. LibPin now carries the parsed KiCad type. Validation applies the option after resolving the actual placed unit, reports how many power pins were ignored, and leaves all non-power pins under the existing rules.

Compatibility and migration

The public field and its default remain unchanged. false preserves existing behavior. true now implements the documented behavior; no schematic is modified.

Validation

  • KONNECT_STATE_DIR=/private/tmp/konnect-power-pins cargo test -p konnect-core power_pin_validation_tests --locked
  • cargo clippy --workspace --locked --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • Combined-series CI commands: docs, Clippy, and format pass; 585/588 konnect-core tests pass, with only the same three installed-Device:R fixture-shadowing failures reproduced on unmodified main.

Risk and rollback

Risk is limited to classification of KiCad's power_in/power_out pin tokens. Unknown types remain validated rather than being skipped. Rollback is one commit after #272.

Schematic validators, exports, connectivity queries, and design-review audits transformed every library pin through each matching reference's first placement. Multi-unit parts therefore reported phantom pins, wrong nets, false audit findings, and unsafe connectivity snaps.

Resolve only the selected unit at every per-instance call site, search all placed units for reference-level queries, identify units in additive response fields, and remove the temporary partial-review diagnostic. Regression fixtures place both units' pins at the same local coordinate so first-instance resolution cannot pass unnoticed.

Refs mixelpixx#182
Preserve each library pin's KiCad electrical type and let the connection validator skip only power_in and power_out pins when requested, with explicit coverage in the result.

Refs mixelpixx#251
@mixelpixx

Copy link
Copy Markdown
Owner

Duplicate of #267's power-pin filter — same code in sch_batch.rs, filed under the #251 narrative instead of #182. See the series note on #285. Please drop this or reduce it to its non-duplicate remainder after #267 and #272 settle.

@nordic-style

Copy link
Copy Markdown
Contributor Author

Closing this duplicate in favor of #267, following the maintainer's guidance to keep the smaller implementation. The consolidated #251 branch is #285 and intentionally carries #267's fix until #267 lands; #280 itself is not included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants